package com.xpchenfrank.test.duoxiancheng;

import com.google.common.collect.Lists;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xpchen
 * @time 2018/4/28 1:20
 * @Description
 * @copyright Wuxi Yazuo ,Ltd.copyright 2015-2025
 */
public class SplitList {

    public static void main(String[] args) {
        List<Long> list = new ArrayList<>();
        list.add(1L);
        list.add(2L);
        list.add(3L);
        list.add(4L);
        list.add(5L);
        list.add(6L);
        list.add(7L);
        list.add(8L);
        list.add(9L);

        test2(list);
    }

    private static void test2(List<Long> list) {
        int size = 2;
        List<List<Long>> subSets = Lists.partition(list, size);
        System.out.println(subSets.toString());
    }
}
